package com.basic.technology.study.introduction.thread.schedule;

import java.util.Timer;
import java.util.TimerTask;

public class ScheduleDemo {

    public static void main(String[] args) {
        Thread abc = new Thread(() -> {
            Timer timer = new Timer();
            System.out.println(System.currentTimeMillis());

            timer.schedule(new TimerTask() {
                public void run() {
                    System.out.println("abc");
                    System.out.println(System.currentTimeMillis());
                }
            }, 5000, 5000);
        });
        abc.setDaemon(true);
        abc.start();

    }
}
